<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">加载中...</span> <span>验证原密码</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="./securityCenter.html" class="iconfont back"></a>
    </header>

    <input type="hidden" name="uid" id="uid" value="{$arr.userid}">
    <div data-v-baaae126="" class="main" s="[object Object]">
        <table data-v-baaae126="">
            <tbody data-v-baaae126="">
            <tr data-v-baaae126="">
                <td data-v-baaae126="">原密码</td>
                <td data-v-baaae126="">
                    <input data-v-baaae126="" type="password" id="password" tag="原密码" placeholder="请输入当前所使用的密码"  class="va60" name="Password">
                </td>
            </tr>
            <tr data-v-baaae126=""></tr>
            </tbody>
        </table>
        <div data-v-baaae126="" class="loginBtn BTN"><a data-v-baaae126="" onclick="sav()">确定</a></div>
    </div>

    <!--密码不正确-->
    <div id="buzhengque" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">-原密码不正确-</div>
                    <div class="layermbtn"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--密码不能为空-->
    <div id="kong" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">-原密码不能为空-</div>
                    <div class="layermbtn"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>


</div>
</body>
</html>
<script>
    $(".layermbtn").click(function(){
        $(this).parents(".layermbox").hide();
    })

function sav(){
    var id = $("#uid").val();
    var password = $("#password").val();
       if(password==""){
           $("#kong").show();
       }
    $.ajax({
        type: "POST",
        url: "{:U('Users/verifyPwd')}",
        data: {'id': id, 'password': password},
        success: function (dat) {
            if (dat == 1) {
                $("#buzhengque").show();
            }else if(dat == 2){
                window.location.href="/Users/setPwd";
            }
        }
    });




}



</script>